package com.example.sys.entity.dto;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.persistence.Id;
import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class UserDto {
    public interface insert {
    }

    ;

    public interface update {
    }

    ;
    /**
     * 主键
     */
    @Id
    private Long userId;
    /**
     * 用户名
     */
    @Length(max = 100, message = "用户名长度不能超过100个字符", groups = {UserDto.insert.class, UserDto.update.class})
    private String userName;
    /**
     * 昵称
     */
    @Length(max = 20, message = "昵称长度不能超过20个字符", groups = {UserDto.insert.class, UserDto.update.class})
    private String nickName;
    /**
     * 用户密码
     */
    private String userPwd;
    /**
     * 头像地址
     */
    private String avatar;
    /**
     * 手机号
     */
    //@Pattern(regexp = "^((13[0-9])|(14[5,7,9])|(15([0-3]|[5-9]))|(166)|(17[0,1,3,5,6,7,8])|(18[0-9])|(19[8|9]))\\d{8}$", message = "手机号不合法", groups = {UserDto.insert.class, UserDto.update.class})
    private String iphoneNo;
    /**
     * 邮箱地址
     */
    //@Email(regexp = "^\\s*\\w+(?:\\.{0,1}[\\w-]+)*@[a-zA-Z0-9]+(?:[-.][a-zA-Z0-9]+)*\\.[a-zA-Z]+\\s*$", message = "邮箱地址不合法", groups = {UserDto.insert.class, UserDto.update.class})
    private String emailAddress;
    /**
     * 性别
     * 1男 2女
     */
    private Integer gender;
    /**
     * 身份证号
     */
    //@Pattern(regexp = "", message = "身份证号不合法", groups = {UserDto.insert.class, UserDto.update.class})
    private String identityCard;
    /**
     * 家庭住址
     */
    private String homeAddress;
    /**
     * 简介
     */
    private String briefIntroduction;
    /**
     * 用户状态
     * 1在用 0冻结
     */
    private Integer status;
    /**
     * 排序
     */
    private Long showOrder;
    /**
     * 创建时间
     */
    private LocalDateTime createTime;
    /**
     * 更新时间
     */
    private LocalDateTime updateTime;
}
